Fix PromoteReplica call in ERS#15934
Conversation
Signed-off-by: Manan Gupta <manan@planetscale.com>
… set replication source Signed-off-by: Manan Gupta <manan@planetscale.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15934 +/- ##
==========================================
- Coverage 68.47% 68.46% -0.02%
==========================================
Files 1562 1562
Lines 197083 197080 -3
==========================================
- Hits 134962 134936 -26
- Misses 62121 62144 +23 ☔ View full report in Codecov by Sentry. |
deepthi
left a comment
There was a problem hiding this comment.
I have a few comments that I think are important to resolve before this can be merged.
Also, can we create a test case for the context fix? We'd have to write the test without this PR's changes first and make sure it fails, and that it passes with this PR.
Signed-off-by: Manan Gupta <manan@planetscale.com>
|
@deepthi Added the test as well, which I ensured failed before the changes. |
Signed-off-by: Manan Gupta <manan@planetscale.com>
mattlord
left a comment
There was a problem hiding this comment.
Where did this change? It was not apparent to me:
We now run PromoteReplica in parallel with SetReplicationSource
I wanted to understand and confirm that part (sorry if I just missed something obvious). Other than that, just minor comments.
|
Thank you for the review @mattlord. I'll work on addressing them 👍. As far as the changes for running |
Signed-off-by: Manan Gupta <manan@planetscale.com>
OK, I see. So here: https://github.com/vitessio/vitess/pull/15934/files#diff-aace4cbbbebad37f5072421e16ca464c0f0b4eb98ad287380c2c764d11e7b836R310-R311 We're calling the |
mattlord
left a comment
There was a problem hiding this comment.
I only had minor comments/requests left so approving so that you can merge when you've addressed those as you feel is best.
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
|
Thank you @mattlord! I've addressed all the review comments, and just waiting for the tests now! 🚀 |
Description
As described in #15935, running PromoteReplica before calling
SetReplicationSourceon the replicas is an issue as it can causePromoteReplicato indefinitely hang.This PR fixes 2 issues -
PromoteReplicain parallel withSetReplicationSource. This also allows us to not run thePrimaryPositionRPC separately, sincePromoteReplicaalso returns the position of the primary.PromoteReplicaandInitPrimaryboth were being called without adding a context timeout. This has also been fixed now.Related Issue(s)
Checklist
Deployment Notes